<template>
  <div class="hello">
    <input v-model="number">
    <button @click="increment">+1</button>
  </div>
</template>

<script >
import { ref } from 'vue';

export default {
  setup() {
    const number = ref(0); // 定义一个响应式变量

    const increment = () => {
      number.value += 1; // 增加数字
    };

    return {
      number,
      increment,
    };
  },
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
